﻿using System;
using System.Collections.Generic;
using System.Text;
using T.FAS.Runtime.UserProfile.Dao;
using T.FAS.Runtime.UserProfile.Entity;
using T.FAS.Runtime.UserProfile.SGSPI;
using T.ServiceComponent.Kernel.Service;

namespace T.FAS.Runtime.UserProfile.Service
{
    /// <summary>
    /// 组件元数据服务
    /// </summary>
    [SGService]
    public class UserProfilesService: IUserProfileService
    {
        /// <summary>
        /// 新增或修改
        /// </summary>
        [SGService(ServiceID = "FASD-CreateOrUpdateUserProfile")]
        public Dictionary<string, string> CreateOrUpdateUserProfile(UserProfiles profile)
        {
            return new UserProfilesManager().CreateOrUpdateUserProfile(profile);
        }
        /// <summary>
        /// 删除
        /// </summary>
        public Dictionary<string, string> DeleteUserProfile(string profileID)
        {
            return new UserProfilesManager().DeleteUserProfile(profileID);
        }
        /// <summary>
        /// 获取配置
        /// </summary>
        [SGService(ServiceID = "FASD-GetUserProfile")]
        public UserProfiles GetUserProfile(string profileItemID)
        {
            UserProfiles userProfiles = new UserProfilesManager().GetUserProfile(profileItemID);
            return userProfiles;
        }
        /// <summary>
        /// 获取用户配置列表
        /// </summary>
        public List<UserProfiles> GetUserProfiles(string profileGroupID)
        {
            List<UserProfiles> userProfiles = new UserProfilesManager().GetUserProfiles(profileGroupID);
            return userProfiles;
        }
    }
}
